<?php
include_once "../../../../common.php";

if(isseT($_GET['id']) && is_numeric($_GET['id']) && !empty($_GET['id']))
{
	
	$query = "SELECT * FROM ProductCatogorien WHERE CatogorieID = '".str_replace("'","",$_GET['id'])."' ORDER BY Naam";
	$result = $_MySQL->runQuery($query);
	while($row = mysql_fetch_assoc($result))
	{
		?>
		<li>
		<?php
		if(catogorieHasSub($row['ID']))
		{
			echo '<a href="#" onClick="javascript: getSubCat(\''.$row['ID'].'\'); return false;">';
			echo "[+]";
			echo "</a>&nbsp;";
			echo '<a href="#" onClick="javascript: selecteerCatogorie(\''.$row['ID'].'\'); return false;">';
			echo $row['Naam'];
			echo "</a>";
			?>
			<ul id="cat<?=$row['ID'];?>"></ul>
			<?php
		}
		else
		{
			echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
			echo '<a href="#" onClick="javascript: selecteerCatogorie(\''.$row['ID'].'\'); return false;">';
			echo $row['Naam'];
			echo "</a>";
		}
		?>
		</li>
		<?php
	}
}
else
{
	?>
	<b>ERROR</b>
	<?php
}
?>